
package server.cashshop;



import org.jetbrains.annotations.NotNull;


 public class CashItemInfo
         {
       private final int itemId;
       private final int count;
       private final int price;
       private final int meso;
       private final int originalPrice;
       private final int sn;
       private final int period;
       private final int gender;
       private final byte csClass;
       private final byte priority;
       private final int termStart;
       private final int termEnd;
       private final boolean onSale;
       private final boolean bonus;
       private final boolean refundable;
       private final boolean discount;



    public CashItemInfo(int itemId, int count, int price, int originalPrice, int meso, int sn, int period, int gender, byte csClass, byte priority, int termStart, int termEnd, boolean sale, boolean bonus, boolean refundable, boolean discount) {
        /*  25 */
        this.itemId = itemId;
        /*  26 */
        this.count = count;
        /*  27 */
        this.price = price;
        /*  28 */
        this.originalPrice = originalPrice;
        /*  29 */
        this.meso = meso;
        /*  30 */
        this.sn = sn;
        /*  31 */
        this.period = period;
        /*  32 */
        this.gender = gender;
        /*  33 */
        this.csClass = csClass;
        /*  34 */
        this.priority = priority;
        /*  35 */
        this.termStart = termStart;
        /*  36 */
        this.termEnd = termEnd;
        /*  37 */
        this.onSale = sale;
        /*  38 */
        this.bonus = bonus;
        /*  39 */
        this.refundable = refundable;
        /*  40 */
        this.discount = discount;

    }








    public int getItemId() {
        /*  49 */
        return this.itemId;

    }








    public int getCount() {
        /*  58 */
        return this.count;

    }







    public int getPrice() {
        /*  66 */
        return Math.max(this.price, this.originalPrice);

    }






    public int getOriginalPrice() {
        /*  73 */
        return this.originalPrice;

    }



    public int getSN() {
        /*  77 */
        return this.sn;

    }



    public int getPeriod() {
        /*  81 */
        return this.period;

    }



    public int getGender() {
        /*  85 */
        return this.gender;

    }



    public boolean onSale() {
        /*  89 */
        CashModInfo modInfo = CashItemFactory.getInstance().getModInfo(this.sn);
        /*  90 */
        if (modInfo != null) {
            /*  91 */
            return modInfo.showUp;

        }
        /*  93 */
        return this.onSale;

    }



    public boolean genderEquals(int g) {
        /*  97 */
        return (g == this.gender || this.gender == 2);

    }



    public boolean isBonus() {
        /* 101 */
        return this.bonus;

    }



    public boolean isRefundable() {
        /* 105 */
        return this.refundable;

    }



    public boolean isDiscount() {
        /* 109 */
        return this.discount;

    }



    public int getMeso() {
        /* 113 */
        return this.meso;

    }



    public byte getCsClass() {
        /* 117 */
        return this.csClass;

    }



    public byte getPriority() {
        /* 121 */
        return this.priority;

    }



    public int getTermStart() {
        /* 125 */
        return this.termStart;

    }



    public int getTermEnd() {
        /* 129 */
        return this.termEnd;

    }

       public static class CashModInfo {
        private int discountPrice;
        private int mark;
        private int priority;
        private int sn;
        private int itemid;
             private int flags;
             private int period;
             private int gender;
             private int count;
             private int meso;



        public CashModInfo(int sn, int discount, int mark, boolean show, int itemid, int priority, boolean packagez, int period, int gender, int count, int meso, int csClass, int termStart, int termEnd, int extra_flags, int fameLimit, int levelLimit, int categories, boolean base_new) {
            /* 139 */
            this.sn = sn;
            /* 140 */
            this.itemid = itemid;
            /* 141 */
            this.discountPrice = discount;
            /* 142 */
            this.mark = mark;
            /* 143 */
            this.showUp = show;
            /* 144 */
            this.priority = priority;
            /* 145 */
            this.packagez = packagez;
            /* 146 */
            this.period = period;
            /* 147 */
            this.gender = gender;
            /* 148 */
            this.count = count;
            /* 149 */
            this.meso = meso;
            /* 150 */
            this.csClass = csClass;
            /* 151 */
            this.termStart = termStart;
            /* 152 */
            this.termEnd = termEnd;
            /* 153 */
            this.extra_flags = extra_flags;
            /* 154 */
            this.flags = extra_flags;
            /* 155 */
            this.fameLimit = fameLimit;
            /* 156 */
            this.levelLimit = levelLimit;
            /* 157 */
            this.categories = categories;
            /* 158 */
            this.base_new = base_new;

            /* 160 */
            if (this.itemid > 0) {
                /* 161 */
                this.flags |= 0x1;

            }
            /* 163 */
            if (this.count > 0) {
                /* 164 */
                this.flags |= 0x2;

            }
            /* 166 */
            if (this.discountPrice > 0) {
                /* 167 */
                this.flags |= 0x4;

            }



            /* 172 */
            if (this.priority >= 0) {
                /* 173 */
                this.flags |= 0x10;

            }
            /* 175 */
            if (this.period > 0) {
                /* 176 */
                this.flags |= 0x20;

            }

            /* 179 */
            if (this.meso > 0) {
                /* 180 */
                this.flags |= 0x80;

            }
            /* 182 */
            if (this.gender >= 0) {
                /* 183 */
                this.flags |= 0x200;

            }

            /* 186 */
            this.flags |= 0x400;

            /* 188 */
            if (this.mark >= -1 || this.mark <= 15) {
                /* 189 */
                this.flags |= 0x800;

            }

            /* 192 */
            if (this.fameLimit > 0) {
                /* 193 */
                this.flags |= 0x20000;

            }
            /* 195 */
            if (this.levelLimit > 0) {
                /* 196 */
                this.flags |= 0x40000;

            }
            /* 198 */
            if (this.termStart > 0) {
                /* 199 */
                this.flags |= 0x80000;

            }
            /* 201 */
            if (this.termEnd > 0) {
                /* 202 */
                this.flags |= 0x100000;

            }
            /* 204 */
            if (this.categories > 0)
                /* 205 */ this.flags |= 0x800000;

        }

             private int csClass;
        private int termStart;
        private int termEnd;
        private int extra_flags;
        private int fameLimit;
        private int levelLimit;
        private int categories;
        private boolean showUp;
        private boolean packagez;
        private boolean base_new;
        private CashItemInfo cii;



        public int getDiscountPrice() {
            /* 210 */
            return this.discountPrice;

        }



        public void setDiscountPrice(int discountPrice) {
            /* 214 */
            this.discountPrice = discountPrice;

        }



        public int getMark() {
            /* 218 */
            return this.mark;

        }



        public void setMark(int mark) {
            /* 222 */
            this.mark = mark;

        }



        public int getPriority() {
            /* 226 */
            return this.priority;

        }



        public void setPriority(int priority) {
            /* 230 */
            this.priority = priority;

        }



        public int getSn() {
            /* 234 */
            return this.sn;

        }



        public void setSn(int sn) {
            /* 238 */
            this.sn = sn;

        }



        public int getItemid() {
            /* 242 */
            return this.itemid;

        }



        public void setItemid(int itemid) {
            /* 246 */
            this.itemid = itemid;

        }



        public int getFlags() {
            /* 250 */
            return this.flags;

        }



        public void setFlags(int flags) {
            /* 254 */
            this.flags = flags;

        }



        public int getPeriod() {
            /* 258 */
            return this.period;

        }



        public void setPeriod(int period) {
            /* 262 */
            this.period = period;

        }



        public int getGender() {
            /* 266 */
            return this.gender;

        }



        public void setGender(int gender) {
            /* 270 */
            this.gender = gender;

        }



        public int getCount() {
            /* 274 */
            return this.count;

        }



        public void setCount(int count) {
            /* 278 */
            this.count = count;

        }



        public int getMeso() {
            /* 282 */
            return this.meso;

        }



        public void setMeso(int meso) {
            /* 286 */
            this.meso = meso;

        }



        public int getCsClass() {
            /* 290 */
            return this.csClass;

        }



        public void setCsClass(int csClass) {
            /* 294 */
            this.csClass = csClass;

        }



        public int getTermStart() {
            /* 298 */
            return this.termStart;

        }



        public void setTermStart(int termStart) {
            /* 302 */
            this.termStart = termStart;

        }



        public int getTermEnd() {
            /* 306 */
            return this.termEnd;

        }



        public void setTermEnd(int termEnd) {
            /* 310 */
            this.termEnd = termEnd;

        }



        public int getExtra_flags() {
            /* 314 */
            return this.extra_flags;

        }



        public void setExtra_flags(int extra_flags) {
            /* 318 */
            this.extra_flags = extra_flags;

        }



        public int getFameLimit() {
            /* 322 */
            return this.fameLimit;

        }



        public void setFameLimit(int fameLimit) {
            /* 326 */
            this.fameLimit = fameLimit;

        }



        public int getLevelLimit() {
            /* 330 */
            return this.levelLimit;

        }



        public void setLevelLimit(int levelLimit) {
            /* 334 */
            this.levelLimit = levelLimit;

        }



        public int getCategories() {
            /* 338 */
            return this.categories;

        }



        public void setCategories(int categories) {
            /* 342 */
            this.categories = categories;

        }



        public boolean isShowUp() {
            /* 346 */
            return this.showUp;

        }



        public void setShowUp(boolean showUp) {
            /* 350 */
            this.showUp = showUp;

        }



        public boolean isPackagez() {
            /* 354 */
            return this.packagez;

        }



        public void setPackagez(boolean packagez) {
            /* 358 */
            this.packagez = packagez;

        }



        public boolean isBase_new() {
            /* 362 */
            return this.base_new;

        }



        public void setBase_new(boolean base_new) {
            /* 366 */
            this.base_new = base_new;

        }



        public CashItemInfo getCii() {
            /* 370 */
            return this.cii;

        }



        public void setCii(CashItemInfo cii) {
            /* 374 */
            this.cii = cii;

        }

        public CashItemInfo toCItem(@NotNull CashItemInfo backup) {

            int item, c, price, expire, gen;

            boolean onSale;
            if (this.cii != null) {
                /* 379 */
                return this.cii;

            }


            /* 383 */
            if (this.itemid <= 0) {
                /* 384 */
                item = backup.getItemId();

            } else {
                /* 386 */
                item = this.itemid;

            }
            /* 388 */
            if (this.count <= 0) {
                /* 389 */
                c = backup.getCount();

            } else {
                /* 391 */
                c = this.count;

            }
            /* 393 */
            if (this.meso <= 0) {
                /* 394 */
                if (this.discountPrice <= 0) {
                    /* 395 */
                    price = backup.getPrice();

                } else {
                    /* 397 */
                    price = this.discountPrice;

                }

            } else {
                /* 400 */
                price = this.meso;

            }
            /* 402 */
            if (this.period <= 0) {
                /* 403 */
                expire = backup.getPeriod();

            } else {
                /* 405 */
                expire = this.period;

            }
            /* 407 */
            if (this.gender < 0) {
                /* 408 */
                gen = backup.getGender();

            } else {
                /* 410 */
                gen = this.gender;

            }
            /* 412 */
            if (!this.showUp) {
                /* 413 */
                onSale = backup.onSale();

            } else {
                /* 415 */
                onSale = this.showUp;

            }

            /* 418 */
            this.cii = new CashItemInfo(item, c, price, price, this.meso, this.sn, expire, gen, backup.csClass, backup.priority, backup.termStart, backup.termEnd, onSale, false, false, false);
            /* 419 */
            return this.cii;

        }
    }


}


/* Location:              C:\PGX\Server.jar!\server\cashshop\CashItemInfo.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */